package cn.ruituo.adv2;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class QieJihe {
    public static void main(String[] args) {
        List list=new LinkedList();
        list.add(new Pengiun("大花",3,"帝企鹅"));
        list.add(new Pengiun("二花",2,"帝企鹅"));
        list.add(new Pengiun("小花",1,"小黄企鹅"));
        Pengiun p=new Pengiun("小花",15,"小蓝企鹅");
        System.out.println(list.contains(p));

        Pengiun p2=new Pengiun("哈巴",4,"北极企鹅");
        list.add(p2);

        ////>>>>list.addFirst(p2);不能好用！！！
       list.add("ssss");

        //indexOf :位置
        //Vector//LinkedList//Stack  addFirst
        System.out.println(">>>>>>>>>>>>>>>>>>>");
        for(int i=0;i<list.size();i++){
            Pengiun pp=(Pengiun) list.get(i);
            System.out.println(pp);
        }
    }
}
